﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace UI.ModSalesman
{
    public partial class SalemanCodeForInput : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string strSearchWord = txtSearchWord.Text.Trim();

            string strSearchSQL = "SELECT [DeptName], [EmpName], [EmpSex], [EmpCode],[DutyName] FROM Admin_Salesman Where StateName<>'离职' and (EmpName like '%" + strSearchWord + "%' OR EmpCode like '%" + strSearchWord + "%')  ORDER BY JoinTime";
            EmployeeSDS.SelectCommand = strSearchSQL;
            gvEmployee.DataSourceID = EmployeeSDS.ID;
        }

        protected void gvEmployee_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            gvEmployee.PageIndex = e.NewPageIndex;
            string strSearchWord = txtSearchWord.Text.Trim();

            string strSearchSQL = "SELECT [DeptName], [EmpName], [EmpSex], [EmpCode],[DutyName] FROM Admin_Salesman Where StateName<>'离职' and (EmpName like '%" + strSearchWord + "%' OR EmpCode like '%" + strSearchWord + "%')  ORDER BY JoinTime";
            EmployeeSDS.SelectCommand = strSearchSQL;
            gvEmployee.DataSourceID = EmployeeSDS.ID;
        }
    }
}